<div class="box">
  <div class="box-header">
    
    <a class="btn game_update" href="javascript:;" url="{:url('index/index/updateMobileGame')}">一键更新</a>
    
    <div class="box-tools ">
        <div class="input-group input-group-sm search-form">
            <input name="search_data" class="pull-right search-input" value="{:input('search_data')}" placeholder="游戏名称" type="text">
            <div class="input-group-btn">
              <button type="button" id="search" url="{:url('mgameList')}" class="btn btn-default"><i class="fa fa-search"></i></button>
            </div>
        </div>
    </div>
    <br/>
  </div>
  <div class="box-body table-responsive">
    <table  class="table table-bordered table-hover">
      <thead>
      <tr>
          <th>类型</th>
          <th>分类</th>
          <th>名称</th>
          <th>头像</th>
          <th>是否推荐</th>
          <th>是否热门</th>
          <th>排序</th>
          <th>创建时间</th>
      </tr>
      </thead>
      
      {notempty name='list'}
        <tbody>
            {volist name='list' id='vo'}
                <tr>
                  <td>
                      {eq name='vo.game_type' value='0'}H5{/eq}
                      {eq name='vo.game_type' value='1'}安卓{/eq}
                  </td>
                  <td>{$vo.category_name}</td>
                  <td>{$vo.game_name}</td>
                  <td><img class="admin-list-img-size" src="{$vo.game_head}"/></td>
                  <td>
                      {eq name='vo.is_recommend' value='1'}
                            <a class="ajax-get" href="{:url('speedySetValue', array('model' => 'MgGame', 'id' => $vo['id'], 'field' => 'is_recommend' , 'value' => 0))}">是</a>
                         {else/}
                            <a class="ajax-get" href="{:url('speedySetValue', array('model' => 'MgGame', 'id' => $vo['id'], 'field' => 'is_recommend' , 'value' => 1))}">否</a>
                      {/eq}
                  </td>
                  <td>
                      {eq name='vo.is_hot' value='1'}
                            <a class="ajax-get" href="{:url('speedySetValue', array('model' => 'MgGame', 'id' => $vo['id'], 'field' => 'is_hot' , 'value' => 0))}">是</a>
                         {else/}
                            <a class="ajax-get" href="{:url('speedySetValue', array('model' => 'MgGame', 'id' => $vo['id'], 'field' => 'is_hot' , 'value' => 1))}">否</a>
                      {/eq}
                  </td>
                  <td>{$vo.sort}</td>
                  <td>{$vo.create_time}</td>
  
                </tr>
            {/volist}
        </tbody>
        {else/}
        <tbody><tr class="odd"><td colspan="8" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
      {/notempty}
    </table>
  </div>

  <div class="box-footer clearfix text-center">
      {$list->render()}
  </div>

</div>

<script>
    
    $(".game_update").click(function(){
        
        var t = $(this);
        
        t.hide();
        
        $.ajax({ url: t.attr('url'), success: function(){
                
            toast.success('更新成功');
            t.show();
        }});
    });
</script>